<!DOCTYPE html>
<html>
<head>
    <title>备件ERP编码选择</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div>
<!--        <Row :gutter="16" style="margin: 8px 0px 0px 1px">-->
<!--            <div class="search-group">-->
<!--                <i-col span="3">-->
<!--                    <i-input v-model="q.name" @on-enter="query" placeholder="备件名称"></i-input>-->
<!--                </i-col>-->
<!--                <i-col span="3">-->
<!--                    <i-input v-model="q.spec" @on-enter="query" placeholder="备件规格"></i-input>-->
<!--                </i-col>-->
<!--                <i-col span="3">-->
<!--                    <i-input v-model="q.partCode" @on-enter="query" placeholder="备件编码"></i-input>-->
<!--                </i-col>-->
<!--                <i-col span="3">-->
<!--                    <i-input v-model="q.erpCode" @on-enter="query" placeholder="ERP编码"></i-input>-->
<!--                </i-col>-->
<!--                <i-col span="3">-->
<!--                    <i-input v-model="q.producor" @on-enter="query" placeholder="供应厂商"></i-input>-->
<!--                </i-col>-->
<!--                <i-button @click="query">查询</i-button>-->
<!--                <i-button @click="reloadSearch">重置</i-button>-->
<!--            </div>-->
<!--        </Row>-->
        <table id="jqGrid"></table>
    </div>
</div>

<script>
    var id = getQueryString('id')
    $(function () {
        $("#jqGrid").Grid({
            url: '../sparepartin/listErpInboundRecord?id='+id,
            colModel: [
                {label: '库房', name: 'subinventoryName', index: 'SUBIN_VENTORY', width: 40},
                {label: '货位编码', name: 'locCode', index: 'LOC_CODE', width: 80},
                {label: '物料代码', name: 'itemCode', index: 'ITEM_CODE', width: 80},
                {label: '入库数', name: 'transactionQuantity', index: 'TRANSACTION_QUANTITY', width: 40},
                {label: '单位', name: 'primaryUomCode', index: 'PRIMARY_UOM_CODE', width: 40},
                {
                    label: '入库日期', name: 'transactionDate', index: 'TRANSACTION_DATE', width: 80, align: 'center',
                    formatter: function (value) {
                        return transDate(value, "yyyy-MM-dd");
                    }
                },
                {label: '事务处理ID', name: 'transactionId', index: 'TRANSACTION_ID', width: 120,hidden: true},

            ]
        });
    });

    let vm = new Vue({
        el: '#rrapp',
        data: {
            q: {
                partName: '', // 备件名称
                spec: '', // 备件规格
                partCode: '', // 备件编码
                erpCode: '', // ERP编码
                producor:'', // 供应厂家
            }
        },
        methods: {
            query: function () {
                vm.reload();
            },
            reload: function (event) {
                let page = $("#jqGrid").jqGrid('getGridParam', 'page');
                $("#jqGrid").jqGrid('setGridParam', {
                    postData: vm.q,
                    page: page
                }).trigger("reloadGrid");
            },
            reloadSearch: function () {
                vm.q = {
                    name: '', // 备件名称
                    spec: '', // 备件规格
                    partCode: '', // 备件编码
                    erpCode: '', // ERP编码
                    producor:'', // 供应厂家
                };
                vm.reload();
            }
        }
    });

    var getSparePart = function () {
        return getSelectedRowData('#jqGrid');
    }
</script>
</body>
</html>
